//
//  FCTextView.h
//  辅城
//
//  Created by jianhong zhang on 2017/9/8.
//  Copyright © 2017年 吴 剑川. All rights reserved.
//

#import <UIKit/UIKit.h>

@class FCTextView;

@protocol FCTextViewDelegate <NSObject>

@optional
- (BOOL)textViewShouldBeginEditing:(FCTextView *)textView;
- (BOOL)textViewShouldEndEditing:(FCTextView *)textView;
- (BOOL)textView:(FCTextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
- (BOOL)textView:(FCTextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange NS_AVAILABLE_IOS(7_0);
- (BOOL)textView:(FCTextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange NS_AVAILABLE_IOS(7_0);

- (void)textViewDidBeginEditing:(FCTextView *)textView;
- (void)textViewDidEndEditing:(FCTextView *)textView;
- (void)textViewDidChange:(FCTextView *)textView;
- (void)textViewDidChangeSelection:(FCTextView *)textView;

@end

@interface FCTextView : UIView

@property(nonatomic,copy)  IBInspectable  NSString   *placeholder;
/** 限制的数量，默认为LONG_MAX不显示 */
@property(nonatomic,assign)IBInspectable  NSInteger  limitNum;
@property(nonatomic,weak)  IBInspectable  NSString   *text;
@property(nonatomic,weak)  IBInspectable  UIColor    *textColor;
@property (nonatomic,strong) NSString *hiddenValue;
@property(nonatomic,weak) UITextView *textView;

@property(nonatomic,weak)    UIFont          *font;
@property(nonatomic,assign)  NSTextAlignment textAlignment;
@property(nonatomic,assign)  UIEdgeInsets    textContainerInset;
@property(nonatomic,weak)    id<FCTextViewDelegate> delegate;

@end
